package com.eshop.we.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.eshop.we.exchangeorder.dto.ExchangeOrderDto;
import com.eshop.we.exchangeorderdetail.entity.ExchangeOrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 * 出租订单明细 Mapper 接口
 * </p>
 *
 * @author anonymity
 * @since 2018-07-06
 */
@Mapper
@Component
public interface ExchangeOrderDetailMapper extends BaseMapper<ExchangeOrderDetail> {


    @Select("select d.*, e.order_num,e.status, e.ctime, e.id as id  from exchange_order e left join exchange_order_detail d on e.id= d.order_id where user_id=#{userId}")
    List<ExchangeOrderDto> selectExchangeRecord(@Param("userId")Integer userId);
}
